import request from '@/utils/request'
export default {
    //1.添加课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: '/eduservice/course/addCourseInfo',
            method: 'post',
            data: courseInfo
        })
    },
    //2.查询所有讲师
    getListTeacher() {
        return request({
            url: '/eduservice/teacher/findAll',
            method: 'get',
        })
    },
    //3.根据课程id查询课程信息
    getCourseInfoId(id) {
        return request({
            url: `/eduservice/course/getCourseInfo/${id}`,
            method: 'get'
        })
    },
    //4.修改课程信息
    updateCourseInfoId(courseInfo) {
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data: courseInfo
        })
    },
    //课程确认信息
    getPublishCourseInfo(id) {
        return request({
            url: `/eduservice/course/getPublishCourseInfo/${id}`,
            method: 'get'
        })
    },
    //课程的最终发布
    publishCourse(id) {
        return request({
            url: `/eduservice/course/publishCourse/${id}`,
            method: 'post'
        })
    },
    //查询所有的课程
    getListCourse(current, limit, courseQuery) {
        return request({
            url: `/eduservice/course/getAllCourse/${current}/${limit}`,
            method: 'post',
            data: courseQuery
        })
    },
    deleteCourse(id) {
        return request({
            url: `/eduservice/course/deleteCourse/${id}`,
            method: 'delete'
        })
    }
}